package cn.yitun.chat.yitunserverimapicore.business.contact.service.impl;

import cn.yitun.chat.yitunservercommonlib.crud.yitun.CrudServiceImpl;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.contact.ContactAddVerifyAnswerDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.po.contact.ContactAddVerifyAnswerInfo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.contact.ContactAddVerifyAnswerVo;
import cn.yitun.chat.yitunservercommonlib.util.R;
import cn.yitun.chat.yitunserverimapicore.business.contact.service.ContactAddVerifyAnswerService;
import cn.yitun.chat.yitunserverimbase.dao.contact.ContactAddVerifyAnswerDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Date 2019-01-20 22:30:07<br>
 * Description
 *
 * @author yitun<br>
 * @version 1.1
 */
@Service
@Transactional
public class ContactAddVerifyAnswerServiceImpl
		extends CrudServiceImpl<ContactAddVerifyAnswerDao, ContactAddVerifyAnswerDto, ContactAddVerifyAnswerInfo, ContactAddVerifyAnswerVo>
		implements ContactAddVerifyAnswerService {

	@Resource
	private ContactAddVerifyAnswerDao contactAddVerifyAnswerDAO;

	public List<ContactAddVerifyAnswerVo> getListByApplyId(Long targetUserId, Long applyId) {
		List<ContactAddVerifyAnswerVo> list = contactAddVerifyAnswerDAO.listVO(
				R.param("targetUserId", targetUserId)
				.put("applyId", applyId));
		return list;
	}

	public List<ContactAddVerifyAnswerVo> getListByApplyIds(Long targetUserId, List<Long> applyIds) {
		List<ContactAddVerifyAnswerVo> list = contactAddVerifyAnswerDAO.listVO(
				R.param("targetUserId", targetUserId)
						.put("applyIds", applyIds)
		);
		return list;
	}
}
